package com.endurance.mapper;

import com.endurance.pojo.Transfer;
import com.mysql.cj.result.Row;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import java.sql.ResultSet;
import java.sql.SQLException;

@Repository
public class TransferMapper implements RowMapper<Transfer> {

    public Transfer mapRow(ResultSet resultSet, int i) throws SQLException {
        Transfer transfer = new Transfer();
        transfer.setName(resultSet.getString("name"));
        transfer.setAccount(resultSet.getDouble("account"));
        return transfer;
    }

}
